//
//  SoCangCell.m
//  OurRelaxDemo
//
//  Created by apple on 15/7/1.
//  Copyright (c) 2015年 于宾尧. All rights reserved.
//

#import "SoCangCell.h"

@implementation SoCangCell
-(void)dealloc
{
    [_name release];
    [_singer release];
    [super dealloc];
}
-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.name = [[UILabel alloc]init];
        [self.contentView addSubview:self.name];
        [_name release];
        
        self.singer = [[UILabel alloc]init];
        [self.contentView addSubview:self.singer];
        [_singer release];
        
    }
    return self;
}
-(void)layoutSubviews
{
    [super layoutSubviews];
    self.name.frame = CGRectMake(0, 0, self.contentView.frame.size.width, self.contentView.frame.size.height / 2);
    
    self.singer.frame = CGRectMake(0, self.contentView.frame.size.height / 2, self.contentView.frame.size.width, self.contentView.frame.size.height / 2);
    self.name.backgroundColor = [UIColor greenColor];
    self.singer.backgroundColor = [UIColor yellowColor];
    
}
-(void)setModel:(DataModel *)model
{
    if (_model != model) {
        [_model release];
        _model = [model retain];
    }
    self.name.text = self.model.name;
    self.singer.text = self.model.singer;
    
    
}
- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
